const contactTypes = [
    {
      title: "手机号",
      value: "1",
      pattern: /^\d{11}$/,
      err: "手机号格式不正确",
    },
    {
      title: "微信",
      value: "2",
      pattern: /^.+$/,
      err: "微信格式不正确",
    },
    {
      title: "座机",
      value: "3",
      pattern: /^\d{3,4}-\d{7,8}(-\d{1,6})?$/,
      err: "座机格式不正确",
    },
  ];
  
  const contactTypesObject = contactTypes.reduce((obj, type) => {
    obj[type.value] = type;
    return obj;
  }, {});
  